#ifndef SPRITE_H
#define SPRITE_H
#include"Entity.h"
#include<QVector2D>
#include<QPixmap>
class Sprite:public Entity
{
public:
    Sprite();
    Sprite(int dx,int dy,int x,int y,const QString &filename);
    void update()override;
    void draw(QPainter *painter)override;
    void moveBy(int x,int y);
    void setpos(int x,int y);
    inline int height()const{return pixmap.height();}
    inline int width()const{return pixmap.width();}
public:
    QPixmap pixmap;
    QVector2D position;
    int speed=3;
    QVector2D velocity;
    QRect collider;
};

#endif // SPRITE_H
